package com.teamit.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.teamit.entity.AtMessage;
import com.teamit.util.db.DBHelp;
import com.teamit.util.db.RowMapper;

public class AtMessageDao {

	DBHelp<AtMessage> db = new DBHelp<AtMessage>();
	
	public void save(AtMessage atMessage){
		
		String sql = "insert into t_atmessage(t_message_id,t_employee_id,t_project_id) values(?,?,?)";
		db.executeSQL(sql, atMessage.getMessageId(),atMessage.getEmployeeId(),atMessage.getProjectId());
	}
	public void update(){
		
	}
	public void findAllByEmployeeid(String projectid){
		
	}
	
	
	private class AtMessageRowMapper implements RowMapper<AtMessage> {

		public AtMessage mapRow(ResultSet rs) throws SQLException {

			AtMessage atMessage = new AtMessage();
			
			atMessage.setEmployeeId(rs.getString("employeeid"));
			atMessage.setMessageId(rs.getString("messageid"));
			atMessage.setProjectId(rs.getString("projectid"));
			
			return atMessage;
		}
		
		
		
		
	}
	
}
